var a = getApp();

Page({
    data: {
        language: "",
        flag_status: !0,
        goods: [],
        goods_template: {},
        album: {},
        album_id: "",
        list: [],
        last_page: 1,
        current_page: 1
    },
    onLoad: function(a) {
        if (a.scene) {
            var t = decodeURIComponent(a.scene);
            if (t) {
                var e = [];
                e = t.split(",");
                for (var n = 0; n < e.length; n++) {
                    var s;
                    "album_id" == (s = e[n].split("="))[0] && this.setData({
                        album_id: s[1]
                    });
                }
            }
        }
        this.getData(this.data.album_id);
    },
    gotoGood: function(a) {
        wx.navigateTo({
            url: "/packageA/detail_v2/detail_v2?id=" + a.currentTarget.dataset.id
        });
    },
    handle: function(a) {
        this.setData({
            flag_status: !this.data.flag_status
        });
    },
    getData: function(t) {
        var e = this;
        a._getNetWork({
            url: a.getNetAddresss("plugin.yz-supply.frontend.album.detail.index"),
            data: {
                page: 1,
                album_id: t
            },
            success: function(a) {
                a.data.result && e.setData({
                    album: a.data.data.album,
                    list: a.data.data.list.data,
                    last_page: a.data.data.list.last_page
                });
            }
        });
    },
    onReady: function() {
        var a = wx.getStorageSync("langIndex");
        this.setData({
            language: a.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var t = this;
        if (!(this.data.current_page >= this.data.last_page)) {
            var e = this.data.current_page + 1;
            a._getNetWork({
                url: a.getNetAddresss("plugin.yz-supply.frontend.album.detail.index"),
                data: {
                    page: e,
                    album_id: this.data.album_id
                },
                success: function(a) {
                    a.data.result && t.setData({
                        list: t.data.list.concat(a.data.data.list.data),
                        current_page: a.data.data.list.current_page
                    });
                }
            });
        }
    },
    onShareAppMessage: function() {}
});